﻿using System;
using System.ComponentModel;
using System.Runtime.InteropServices;

namespace Teigha.Core
{
	public class OdGsCullingBBox : OdGeExtents3d, OdGsCullingPrimitive
	{
		[EditorBrowsable(EditorBrowsableState.Never)]
		public OdGsCullingBBox(IntPtr cPtr, bool cMemoryOwn) : base(GlobalsPINVOKE.OdGsCullingBBox_SWIGUpcast(cPtr), cMemoryOwn)
		{
			this.swigCPtr = new HandleRef(this, cPtr);
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		public static HandleRef getCPtr(OdGsCullingBBox obj)
		{
			if (obj != null)
			{
				return obj.swigCPtr;
			}
			return new HandleRef(null, IntPtr.Zero);
		}

		~OdGsCullingBBox()
		{
			this.Dispose();
		}

		public override void Dispose()
		{
			if (this.swigCPtr.Handle != IntPtr.Zero)
			{
				if (this.swigCMemOwn)
				{
					lock (this.locker)
					{
						if (this.swigCPtr.Handle != IntPtr.Zero && this.swigCMemOwn)
						{
							this.swigCMemOwn = false;
							GlobalsPINVOKE.delete_OdGsCullingBBox(this.swigCPtr);
						}
					}
					this.swigCMemOwn = false;
				}
				this.swigCPtr = new HandleRef(null, IntPtr.Zero);
			}
			GC.SuppressFinalize(this);
			base.Dispose();
		}

		[EditorBrowsable(EditorBrowsableState.Never)]
		HandleRef OdGsCullingPrimitive.GetCPtr()
		{
			return new HandleRef(this, GlobalsPINVOKE.OdGsCullingBBox_OdGsCullingPrimitive_GetCPtr(this.swigCPtr.Handle));
		}

		public OdGsCullingBBox() : this(GlobalsPINVOKE.new_OdGsCullingBBox__SWIG_0(), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBBox(OdGePoint3d min, OdGePoint3d max) : this(GlobalsPINVOKE.new_OdGsCullingBBox__SWIG_1(OdGePoint3d.getCPtr(min), OdGePoint3d.getCPtr(max)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBBox(OdGeExtents3d ext) : this(GlobalsPINVOKE.new_OdGsCullingBBox__SWIG_2(OdGeExtents3d.getCPtr(ext)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBBox(OdGsCullingBBox aabb) : this(GlobalsPINVOKE.new_OdGsCullingBBox__SWIG_3(OdGsCullingBBox.getCPtr(aabb)), true)
		{
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
		}

		public OdGsCullingBBox Assign(OdGeExtents3d ext)
		{
			OdGsCullingBBox result = new OdGsCullingBBox(GlobalsPINVOKE.OdGsCullingBBox_Assign__SWIG_0(this.swigCPtr, OdGeExtents3d.getCPtr(ext)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public OdGsCullingBBox Assign(OdGsCullingBBox aabb)
		{
			OdGsCullingBBox result = new OdGsCullingBBox(GlobalsPINVOKE.OdGsCullingBBox_Assign__SWIG_1(this.swigCPtr, OdGsCullingBBox.getCPtr(aabb)), false);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		public virtual OdGsCullingPrimitiveImpl.PrimitiveType primitiveType()
		{
			OdGsCullingPrimitiveImpl.PrimitiveType result = (OdGsCullingPrimitiveImpl.PrimitiveType)GlobalsPINVOKE.OdGsCullingBBox_primitiveType(this.swigCPtr);
			if (GlobalsPINVOKE.SWIGPendingException.Pending)
			{
				throw GlobalsPINVOKE.SWIGPendingException.Retrieve();
			}
			return result;
		}

		private object locker = new object();

		private HandleRef swigCPtr;
	}
}
